package com.ibeeking.found.upms.g.rest.service;

import com.ibeeking.found.common.entity.CurrentUser;
import com.ibeeking.found.common.entity.LoginUserDTO;
import com.ibeeking.found.upms.api.common.dto.UserInfoDTO;
import com.ibeeking.found.upms.api.common.query.AccountLoginQuery;
import com.ibeeking.found.upms.service.common.bo.GmcUserBO;
import com.ibeeking.found.upms.service.common.param.ModifyMobileParam;
import com.ibeeking.found.upms.service.common.param.UserFindPwdParam;
import com.ibeeking.found.upms.service.common.param.UserModifyPwdParam;
import com.ibeeking.found.upms.service.common.param.GmcUserParam;
import com.ibeeking.found.upms.service.common.query.GmcUserPageQuery;
import com.ibeeking.found.upms.service.common.vo.CurrentPermissionVO;
import com.ibeeking.found.upms.service.common.vo.GmcUserPageVO;
import com.ibeeking.found.upms.service.common.vo.GmcUserVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * @Author ibeeking
 */
public interface IGmcUserService {

    /**
     * @param globalRolePageQuery
     * @return
     */
    Page<GmcUserPageVO> pageList(GmcUserPageQuery globalRolePageQuery);

    Boolean add(GmcUserParam gmcUserParam);

    Boolean modify(GmcUserParam gmcUserParam);

    GmcUserVO view(Long id);

    GmcUserBO queryById(Long id);

    Boolean changeStatus(Long id, Integer status, Long userId);

    Boolean del(Long id);

    Long checkUserCode(String userCode);

    Long checkMobile(String mobile);

    Long checkEmail(String email);

    /**
     * 账号登录查询
     *
     * @param accountLoginQuery
     * @return
     */
    LoginUserDTO queryAccountLogin(AccountLoginQuery accountLoginQuery);

    /**
     * 根据用户id查询用户信息
     *
     * @param userId
     * @return
     */
    UserInfoDTO queryLoginUser(Long userId);

    /**
     * 重置密码
     *
     * @param id
     * @return
     */
    Boolean resetPwd(Long id);

    /**
     * 修改密码
     *
     * @param id
     * @param userModifyPwdParam
     * @return
     */
    Boolean modifyPwd(Long id, UserModifyPwdParam userModifyPwdParam);

    /**
     * 找回密码
     *
     * @param userFindPwdParam
     * @return
     */
    Boolean findPwd(UserFindPwdParam userFindPwdParam);

    /**
     * 获取当前登录用户权限
     *
     * @param currentUser
     * @param jti
     * @return
     */
    List<CurrentPermissionVO> currentPermission(CurrentUser currentUser, String jti);

    /**
     * 查询当前用户角色id
     *
     * @param userId
     * @return
     */
    List<String> queryRoleIdsByUserId(Long userId);

    Boolean checkAdministrator(Long userId);

    Boolean modifyMobile(Long userId, ModifyMobileParam param);
}
